package com.qk2;

public class Test {
	public static void main(String[] agrs){
		MyObjectFactory m=new MyObjectFactory();
		
		Book book=(Book) m.getObject("com.qk2.Book");
		System.out.println(book.getName());
		System.out.println(book.getPrice());
		
		System.out.println();
		
		Dog dog=(Dog) m.getObject("com.qk2.Dog");
		System.out.println(dog.getName());
		System.out.println(dog.getAge());
		System.out.println(dog.getOwn());
	}

}
